#include <Arduino.h>
#include <ESP8266WiFi.h>
#include "Hass-Mqtt.h"
#include "conf.h"
#include <ESP8266WebServer.h>
#include "WiFiConfig.h"
#include "OneButton.h"
#include "Button.h"

extern HassMqtt client;

void setup()
{
  Serial.begin(115200);

  client.keybegin();
  pinMode(STATUS_LED, OUTPUT); // sets the digital pin as output
  digitalWrite(STATUS_LED, HIGH);
  // Connect to WiFi network
  wm_init();
  // Start MQTT
  client.begin();
}

void loop() {
  // put your main code here, to run repeatedly:
  doWiFiManager();
  client.handle();
  client.keyhandle();
  btn_tick();
}

